/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.clbs.ex.springgwt.server.dao.impl;

import com.clbs.ex.springgwt.client.model.IssueStatus;
import com.clbs.ex.springgwt.server.dao.IssueStatusDAO;
import com.clbs.ex.springgwt.server.mapper.IssueStatusMapper;
import java.util.List;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

/**
 *
 * @author peerawat.poombua
 */
public class IssueStatusDAOImpl extends JdbcDaoSupport implements IssueStatusDAO {

    public IssueStatus getIssueStatus(int issueStatusID) {
        String GET_ISSUESTATUS = "SELECT * FROM tblIssueStatus WHERE nIssueStatusID = ?";
        List<IssueStatus> matched = getJdbcTemplate().query(GET_ISSUESTATUS, 
                new Object[]{issueStatusID},
                new IssueStatusMapper());
        return matched.size() > 0 ? matched.get(0) : null;
    }
}
